/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="goods_order")
public class GoodsOrder implements Serializable {
	public GoodsOrder() {
	}
	
	private int id;
	
	private String code;
	
	private cn.imvc.app.entities.Member member;
	
	private cn.imvc.app.entities.Seller seller;
	
	private cn.imvc.app.entities.Storage storage;
	
	private cn.imvc.app.entities.Orders order;
	
	private String orderCode;
	
	private cn.imvc.app.entities.StorageOrder orderStorage;
	
	private String orderStorageCode;
	
	private cn.imvc.app.entities.Goods goods;
	
	private cn.imvc.app.entities.GoodsSku goodsSku;
	
	private String name;
	
	private String title;
	
	private String detail;
	
	private String spec = "";
	
	private Integer price;
	
	private Integer num;
	
	private Integer totals;
	
	private Integer points;
	
	private Integer weight;
	
	private String image;
	
	private Byte freightState;
	
	private Byte isVirtual = new Byte("0");
	
	private Byte state;
	
	private Integer refundAmount;
	
	private java.util.Date refundTime;
	
	private java.util.Date finishTime;
	
	private Byte isSevenDaysReturned;
	
	private java.util.Date createdAt;
	
	private java.util.Date updatedAt;
	
	private Byte commentState;
	
	private Byte isFree;
	
	private java.util.Set comments = new java.util.HashSet();
	
	private java.util.Set inventoryFlow = new java.util.HashSet();
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_GOODSORDER_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_GOODSORDER_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 三级订单编号
	 */
	public void setCode(String value) {
		this.code = value;
	}
	
	/**
	 * 三级订单编号
	 */
	@Column(name="code", nullable=true, length=255)	
	public String getCode() {
		return code;
	}
	
	/**
	 * 一级订单编号
	 */
	public void setOrderCode(String value) {
		this.orderCode = value;
	}
	
	/**
	 * 一级订单编号
	 */
	@Column(name="orderCode", nullable=true, length=255)	
	public String getOrderCode() {
		return orderCode;
	}
	
	/**
	 * 二级订单编号
	 */
	public void setOrderStorageCode(String value) {
		this.orderStorageCode = value;
	}
	
	/**
	 * 二级订单编号
	 */
	@Column(name="orderStorageCode", nullable=true, length=255)	
	public String getOrderStorageCode() {
		return orderStorageCode;
	}
	
	/**
	 * 商品名称
	 */
	public void setName(String value) {
		this.name = value;
	}
	
	/**
	 * 商品名称
	 */
	@Column(name="name", nullable=true, length=255)	
	public String getName() {
		return name;
	}
	
	/**
	 * 显示标题
	 */
	public void setTitle(String value) {
		this.title = value;
	}
	
	/**
	 * 显示标题
	 */
	@Column(name="title", nullable=true, length=255)	
	public String getTitle() {
		return title;
	}
	
	/**
	 * 商品详细
	 */
	public void setDetail(String value) {
		this.detail = value;
	}
	
	/**
	 * 商品详细
	 */
	@Column(name="detail", nullable=true)	
	public String getDetail() {
		return detail;
	}
	
	/**
	 * 商品规格
	 */
	public void setSpec(String value) {
		this.spec = value;
	}
	
	/**
	 * 商品规格
	 */
	@Column(name="spec", nullable=true, length=255)	
	public String getSpec() {
		return spec;
	}
	
	/**
	 * 商品单价
	 */
	public void setPrice(int value) {
		setPrice(new Integer(value));
	}
	
	/**
	 * 商品单价
	 */
	public void setPrice(Integer value) {
		this.price = value;
	}
	
	/**
	 * 商品单价
	 */
	@Column(name="price", nullable=true, length=10)	
	public Integer getPrice() {
		return price;
	}
	
	/**
	 * 购买数量
	 */
	public void setNum(int value) {
		setNum(new Integer(value));
	}
	
	/**
	 * 购买数量
	 */
	public void setNum(Integer value) {
		this.num = value;
	}
	
	/**
	 * 购买数量
	 */
	@Column(name="num", nullable=true, length=10)	
	public Integer getNum() {
		return num;
	}
	
	/**
	 * 总价
	 */
	public void setTotals(int value) {
		setTotals(new Integer(value));
	}
	
	/**
	 * 总价
	 */
	public void setTotals(Integer value) {
		this.totals = value;
	}
	
	/**
	 * 总价
	 */
	@Column(name="totals", nullable=true, length=10)	
	public Integer getTotals() {
		return totals;
	}
	
	/**
	 * 积分
	 */
	public void setPoints(int value) {
		setPoints(new Integer(value));
	}
	
	/**
	 * 积分
	 */
	public void setPoints(Integer value) {
		this.points = value;
	}
	
	/**
	 * 积分
	 */
	@Column(name="points", nullable=true, length=10)	
	public Integer getPoints() {
		return points;
	}
	
	/**
	 * 重量
	 */
	public void setWeight(int value) {
		setWeight(new Integer(value));
	}
	
	/**
	 * 重量
	 */
	public void setWeight(Integer value) {
		this.weight = value;
	}
	
	/**
	 * 重量
	 */
	@Column(name="weight", nullable=true, length=10)	
	public Integer getWeight() {
		return weight;
	}
	
	/**
	 * 商品或规格主图片
	 */
	public void setImage(String value) {
		this.image = value;
	}
	
	/**
	 * 商品或规格主图片
	 */
	@Column(name="image", nullable=true, length=255)	
	public String getImage() {
		return image;
	}
	
	/**
	 *  0免运费，1正常
	 */
	public void setFreightState(byte value) {
		setFreightState(new Byte(value));
	}
	
	/**
	 *  0免运费，1正常
	 */
	public void setFreightState(Byte value) {
		this.freightState = value;
	}
	
	/**
	 *  0免运费，1正常
	 */
	@Column(name="freightState", nullable=true)	
	public Byte getFreightState() {
		return freightState;
	}
	
	/**
	 * 是否为虚拟商品 1是 0否
	 */
	public void setIsVirtual(byte value) {
		setIsVirtual(new Byte(value));
	}
	
	/**
	 * 是否为虚拟商品 1是 0否
	 */
	public void setIsVirtual(Byte value) {
		this.isVirtual = value;
	}
	
	/**
	 * 是否为虚拟商品 1是 0否
	 */
	@Column(name="isVirtual", nullable=true)	
	public Byte getIsVirtual() {
		return isVirtual;
	}
	
	/**
	 * 订单状态 ：10创建订单、11用户取消订单、12系统取消订单、13管理员驳回订单、20付款中、21付款成功、22付款失败、30待发货、31已发货、32发货失败、40确认收货、41系统确认收货、50退货申请、51审核通过、52审核失败、53退货成功 54退货失败、60订单完成
	 */
	public void setState(byte value) {
		setState(new Byte(value));
	}
	
	/**
	 * 订单状态 ：10创建订单、11用户取消订单、12系统取消订单、13管理员驳回订单、20付款中、21付款成功、22付款失败、30待发货、31已发货、32发货失败、40确认收货、41系统确认收货、50退货申请、51审核通过、52审核失败、53退货成功 54退货失败、60订单完成
	 */
	public void setState(Byte value) {
		this.state = value;
	}
	
	/**
	 * 订单状态 ：10创建订单、11用户取消订单、12系统取消订单、13管理员驳回订单、20付款中、21付款成功、22付款失败、30待发货、31已发货、32发货失败、40确认收货、41系统确认收货、50退货申请、51审核通过、52审核失败、53退货成功 54退货失败、60订单完成
	 */
	@Column(name="state", nullable=true)	
	public Byte getState() {
		return state;
	}
	
	/**
	 * 退款金额
	 */
	public void setRefundAmount(int value) {
		setRefundAmount(new Integer(value));
	}
	
	/**
	 * 退款金额
	 */
	public void setRefundAmount(Integer value) {
		this.refundAmount = value;
	}
	
	/**
	 * 退款金额
	 */
	@Column(name="refundAmount", nullable=true, length=10)	
	public Integer getRefundAmount() {
		return refundAmount;
	}
	
	/**
	 * 退款时间
	 */
	public void setRefundTime(java.util.Date value) {
		this.refundTime = value;
	}
	
	/**
	 * 退款时间
	 */
	@Column(name="refundTime", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getRefundTime() {
		return refundTime;
	}
	
	/**
	 * 完成时间
	 */
	public void setFinishTime(java.util.Date value) {
		this.finishTime = value;
	}
	
	/**
	 * 完成时间
	 */
	@Column(name="finishTime", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getFinishTime() {
		return finishTime;
	}
	
	/**
	 * 七天无理由退换
	 */
	public void setIsSevenDaysReturned(byte value) {
		setIsSevenDaysReturned(new Byte(value));
	}
	
	/**
	 * 七天无理由退换
	 */
	public void setIsSevenDaysReturned(Byte value) {
		this.isSevenDaysReturned = value;
	}
	
	/**
	 * 七天无理由退换
	 */
	@Column(name="isSevenDaysReturned", nullable=true)	
	public Byte getIsSevenDaysReturned() {
		return isSevenDaysReturned;
	}
	
	/**
	 * 创建时间
	 */
	public void setCreatedAt(java.util.Date value) {
		this.createdAt = value;
	}
	
	/**
	 * 创建时间
	 */
	@Column(name="createdAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getCreatedAt() {
		return createdAt;
	}
	
	/**
	 * 更新时间
	 */
	public void setUpdatedAt(java.util.Date value) {
		this.updatedAt = value;
	}
	
	/**
	 * 更新时间
	 */
	@Column(name="updatedAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getUpdatedAt() {
		return updatedAt;
	}
	
	public void setCommentState(byte value) {
		setCommentState(new Byte(value));
	}
	
	public void setCommentState(Byte value) {
		this.commentState = value;
	}
	
	@Column(name="commentState", nullable=true)	
	public Byte getCommentState() {
		return commentState;
	}
	
	public void setIsFree(byte value) {
		setIsFree(new Byte(value));
	}
	
	public void setIsFree(Byte value) {
		this.isFree = value;
	}
	
	@Column(name="isFree", nullable=true)	
	public Byte getIsFree() {
		return isFree;
	}
	
	public void setMember(cn.imvc.app.entities.Member value) {
		this.member = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Member.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="memberId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Member getMember() {
		return member;
	}
	
	public void setSeller(cn.imvc.app.entities.Seller value) {
		this.seller = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Seller.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="sellerId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Seller getSeller() {
		return seller;
	}
	
	public void setStorage(cn.imvc.app.entities.Storage value) {
		this.storage = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Storage.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="storageId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Storage getStorage() {
		return storage;
	}
	
	public void setOrder(cn.imvc.app.entities.Orders value) {
		this.order = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Orders.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="orderId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Orders getOrder() {
		return order;
	}
	
	public void setGoods(cn.imvc.app.entities.Goods value) {
		this.goods = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Goods.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="goodsId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Goods getGoods() {
		return goods;
	}
	
	public void setGoodsSku(cn.imvc.app.entities.GoodsSku value) {
		this.goodsSku = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.GoodsSku.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="goodsSkuId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.GoodsSku getGoodsSku() {
		return goodsSku;
	}
	
	public void setOrderStorage(cn.imvc.app.entities.StorageOrder value) {
		this.orderStorage = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.StorageOrder.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="orderStorageId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.StorageOrder getOrderStorage() {
		return orderStorage;
	}
	
	public void setComments(java.util.Set value) {
		this.comments = value;
	}
	
	@OneToMany(mappedBy="goodsOrder", targetEntity=cn.imvc.app.entities.Comments.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getComments() {
		return comments;
	}
	
	
	public void setInventoryFlow(java.util.Set value) {
		this.inventoryFlow = value;
	}
	
	@OneToMany(mappedBy="goodsOrder", targetEntity=cn.imvc.app.entities.InventoryFlow.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getInventoryFlow() {
		return inventoryFlow;
	}
	
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("GoodsOrder[ ");
			sb.append("Id=").append(getId()).append(" ");
			sb.append("Code=").append(getCode()).append(" ");
			if (getMember() != null)
				sb.append("Member.Persist_ID=").append(getMember().toString(true)).append(" ");
			else
				sb.append("Member=null ");
			if (getSeller() != null)
				sb.append("Seller.Persist_ID=").append(getSeller().toString(true)).append(" ");
			else
				sb.append("Seller=null ");
			if (getStorage() != null)
				sb.append("Storage.Persist_ID=").append(getStorage().toString(true)).append(" ");
			else
				sb.append("Storage=null ");
			if (getOrder() != null)
				sb.append("Order.Persist_ID=").append(getOrder().toString(true)).append(" ");
			else
				sb.append("Order=null ");
			sb.append("OrderCode=").append(getOrderCode()).append(" ");
			if (getOrderStorage() != null)
				sb.append("OrderStorage.Persist_ID=").append(getOrderStorage().toString(true)).append(" ");
			else
				sb.append("OrderStorage=null ");
			sb.append("OrderStorageCode=").append(getOrderStorageCode()).append(" ");
			if (getGoods() != null)
				sb.append("Goods.Persist_ID=").append(getGoods().toString(true)).append(" ");
			else
				sb.append("Goods=null ");
			if (getGoodsSku() != null)
				sb.append("GoodsSku.Persist_ID=").append(getGoodsSku().toString(true)).append(" ");
			else
				sb.append("GoodsSku=null ");
			sb.append("Name=").append(getName()).append(" ");
			sb.append("Title=").append(getTitle()).append(" ");
			sb.append("Detail=").append(getDetail()).append(" ");
			sb.append("Spec=").append(getSpec()).append(" ");
			sb.append("Price=").append(getPrice()).append(" ");
			sb.append("Num=").append(getNum()).append(" ");
			sb.append("Totals=").append(getTotals()).append(" ");
			sb.append("Points=").append(getPoints()).append(" ");
			sb.append("Weight=").append(getWeight()).append(" ");
			sb.append("Image=").append(getImage()).append(" ");
			sb.append("FreightState=").append(getFreightState()).append(" ");
			sb.append("IsVirtual=").append(getIsVirtual()).append(" ");
			sb.append("State=").append(getState()).append(" ");
			sb.append("RefundAmount=").append(getRefundAmount()).append(" ");
			sb.append("RefundTime=").append(getRefundTime()).append(" ");
			sb.append("FinishTime=").append(getFinishTime()).append(" ");
			sb.append("IsSevenDaysReturned=").append(getIsSevenDaysReturned()).append(" ");
			sb.append("CreatedAt=").append(getCreatedAt()).append(" ");
			sb.append("UpdatedAt=").append(getUpdatedAt()).append(" ");
			sb.append("CommentState=").append(getCommentState()).append(" ");
			sb.append("IsFree=").append(getIsFree()).append(" ");
			sb.append("Comments.size=").append(getComments().size()).append(" ");
			sb.append("InventoryFlow.size=").append(getInventoryFlow().size()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
